package com.example.demo.serviec;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.demo.mapper.NewStuMapper;
import com.example.demo.pojo.NewStu;

@Service
public class StuService {
	
	@Autowired
	private NewStuMapper stuMapper;
	
	public List<NewStu> getStu() {
		return stuMapper.selectAll();
	}
	
	public void insertStu(NewStu stu) {
		stuMapper.insert(stu);
	}
	
	public void updateStu(NewStu stu) {
		stuMapper.updateByPrimaryKey(stu);
	}
	
	public void deleteStu(NewStu stu) {
		stuMapper.deleteByPrimaryKey(stu);
	}
	
	
}
